# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Daurnimator <daurnimator@archlinux.org>
# Old Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>
# contributor: Cameron Banta <cbanta@gmail.com>

pkgname=(lua-alt-getopt lua51-alt-getopt lua52-alt-getopt lua53-alt-getopt)
pkgver=0.8.0
pkgrel=1
pkgdesc="Lua module for processing options similar to getopt_long(3)"
license=('MIT')
arch=('any')
url="https://github.com/cheusov/lua-alt-getopt"
source=("https://github.com/cheusov/lua-alt-getopt/archive/${pkgver}.tar.gz")
sha512sums=('1c0768e98793ee060a8a70bc47355abf5feac3b51d9844a26816267c0901df9f30c9ef3280766dec2c5b754123ca548c8f49cb294bf4f04c378c62ea377e09de')

package_lua51-alt-getopt() {
  pkgdesc="$pkgdesc for Lua 5.1"

  cd "${pkgbase}-${pkgver}"
  install -Dm644 alt_getopt.lua "${pkgdir}/usr/share/lua/5.1/alt_getopt.lua"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_lua52-alt-getopt() {
  pkgdesc="$pkgdesc for Lua 5.2"

  cd "${pkgbase}-${pkgver}"
  install -Dm644 alt_getopt.lua "${pkgdir}/usr/share/lua/5.2/alt_getopt.lua"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_lua53-alt-getopt() {
  pkgdesc="$pkgdesc for Lua 5.3"

  cd "${pkgbase}-${pkgver}"
  install -Dm644 alt_getopt.lua "${pkgdir}/usr/share/lua/5.3/alt_getopt.lua"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_lua-alt-getopt() {
  pkgdesc="$pkgdesc for Lua 5.4"

  cd "${pkgbase}-${pkgver}"
  install -Dm644 alt_getopt.lua "${pkgdir}/usr/share/lua/5.4/alt_getopt.lua"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
